#ifndef TRIANGLE_H
#define TRIANGLE_H

#include "glwidget.h"

class Triangle : public GLWidget
{
    Q_OBJECT
public:
    Triangle(QWidget *parent = 0);

    void initialize();
    void render();
    void update();

    void updateX(float x);
    void updateW(float w);

    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *event);
    void wheelEvent(QWheelEvent* event);

    GLfloat m_x;
    GLfloat m_w;

signals:
    void x0changed();

private:
    QVector2D mousePressPosition;
    GLfloat m_change;
    QVector2D m_massPos;
    GLfloat m_zoom;
    GLfloat m_cubeSize;
    bool canMove;
};

#endif // TRIANGLE_H
